<template>
  <div>
    <!-- 文章列表首页 -->
    <div class="w index">
      <el-row>
        <el-col :xs="24" :md="24" :lg="18">
          <!-- 文章列表页 -->
          <ArticleList></ArticleList>
        </el-col>
        <el-col
          :xs="0"
          :md="6"
          :lg="6"
          class="hidden-md-and-down"
          type="flex"
          justify="center"
          align="middle"
        >
          <div class="cardlist" id="cardlist">
            <div class="about">
              <el-card>
                <h1><i class="el-icon-user">关于作者</i></h1>
                <el-avatar :size="88" :src="blogInfo.avatar"></el-avatar>
                <h1>{{ blogInfo.name }}</h1>
                <!-- 博客信息 -->
                <div class="siteinfo">
                  <el-row>
                    <el-col :span="6"
                      ><h1>文章</h1>
                      <span>{{ blogInfo.articleCount }}</span></el-col
                    >
                    <el-col :span="6"
                      ><h1>分类</h1>
                      <span>{{ blogInfo.categoryCount }}</span></el-col
                    >
                    <el-col :span="6"
                      ><h1>标签</h1>
                      <span>{{ blogInfo.tagCount }}</span></el-col
                    >
                    <el-col :span="6"
                      ><h1>访问</h1>
                      <span>{{ blogInfo.viewCount }}</span></el-col
                    >
                  </el-row>
                </div>
              </el-card>
            </div>
            <div class="hot">
              <el-card>通知</el-card>
            </div>
            <div class="hot">
              <el-card>热门文章</el-card>
            </div>
          </div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
import ArticleList from "@/views/article/components/ArticleList.vue";
export default {
  data() {
    return {
      blogInfo: {
        name: "",
        address: "",
      },
    };
  },
  methods: {
    // 初始化
    init() {
      this.about();
    },
    about() {
      this.getRequest("/api/").then((res) => {
        this.blogInfo = res.data;
      });
    },
  },
  components: {
    ArticleList,
  },
  mounted() {
    this.init();
  },
};
</script>

<style lang="less" scoped>
.indexbanner {
  width: 100vw;
  height: 100vh;
}

.index {
  position: relative;
}

.cardlist {
  margin-top: 60px;
  .about {
    .el-card {
      // height: 388px;
      margin-bottom: 20px;
      border-radius: 15px;
      h1 {
        font-size: 20px;
        color: #666;
      }
    }
  }
}
.hot {
  margin-bottom: 20px;
}
</style>